package com.xgp.jvm;

import java.util.ArrayList;

/**
 * -Xms1m -Xmx8m -XX:+HeapDumpOnOutOfMemoryError
 */
public class Demo5 {

    byte[] array = new byte[1*1024*1024];

    public static void main(String[] args) {
        ArrayList<Demo5> list = new ArrayList<>();
        int count = 0;

        try {
            while(true) {
                list.add(new Demo5());
                count++;
            }
        }catch (Exception e) {
            System.out.println("=============");
            e.printStackTrace();
        }


    }
}
